#include "Q7_1.h"

void ShowDate(Date date)
{
	printf("%d, %02d-%02d-%d\n", date.dow, date.day, date.month, date.year);
	printf("%02d/%02d/%d\n", date.day, date.month, date.year);
	printf("%d-%02d-%d\n", date.day, date.month, date.year);
	printf("%d, %02d.%02d.%d\n", date.dow, date.day, date.month, date.year);
}

Date::a_t(unsigned char dow, unsigned char day, unsigned char month, unsigned int year)
{
	Date::dow = dow;
	Date::day = day;
	Date::month = month;
	Date::year = year;
}

void q7_1_run()
{
	struct tm *tm_date;
	Date date;
	time_t *time_now = new time_t();
	time(time_now);
	tm_date = localtime(time_now);

	date.dow = tm_date->tm_wday;
	date.day = tm_date->tm_mday;
	date.month = tm_date->tm_mon;
	date.year = tm_date->tm_year + 1900;

	ShowDate(date);
}